home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14123 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: mother.usf.edu!suntan!cdiaz
  2. From: "Carlos Diaz (CS)" <cdiaz@eng.usf.edu>
  3. Newsgroups: comp.lang.c
  4. Subject: #include "" for large programs.
  5. Date: Thu, 11 Apr 1996 20:05:59 -0400
  6. Organization: University of South Florida
  7. Message-ID: <Pine.SUN.3.92.960411195730.24973A-100000@suntan>
  8. NNTP-Posting-Host: suntan.eng.usf.edu
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11. X-Sender: cdiaz@suntan
  12.  
  13. Hello!
  14.  I've been writing short two part programs using the #include "filename"
  15. preprocessor.
  16.  I call one file main.c and the other part2.c, for which there is a
  17. prototype header file part2.h.
  18.  All works well when I compile the programs, except when  part2.h has
  19. #define constants (I've been advised by my professor to use #define for
  20. constants over 'const type var_name'). My compiler returns a fatal error
  21. reporting that the symbol in the #define is not defined.
  22.  For example if #define EQUAL 0 is part of part2.h, I'm told that the
  23. symbol EQUAL is not defined. But if I put the #define inside main.c, I'm
  24. told that I've defined EQUAL  TWICE, once in part2.h and again within
  25. main. The book we're using in class is not helping at all in this subject,
  26. and I cannot figure out why everything else is recognized, except #define
  27. constants. Can anyone here help? If the answer to this is in the FAQ, just
  28. tell me where to download it from. Thanks!
  29.  
  30. -Carlos E. Diaz
  31.  
  32.  
  33.